﻿<html xmlns="http://www.w3.org/1999/xhtml">

<!-- Head -->
<head>

	<title><?= $site->name ?> - 后台管理</title>
	<?php $this->load->view( 'common/header' ); ?>
</head>
<!-- /Head -->
<!-- Body -->
<body>
<!-- Topbar -->
<?php
$this->load->view( 'common/topbar.php' );
?>
<!-- /Topbar -->
<!-- Main Container -->
<div class="main-container container-fluid">
<!-- Page Container -->
<div class="page-container">
<!-- Page Sidebar -->
<div class="page-sidebar" id="sidebar">
	<!-- Page Sidebar Header-->
	<div class="sidebar-header-wrapper">
		<input type="text" class="searchinput"/>
		<i class="searchicon fa fa-search"></i>

		<div class="searchhelper">搜索文章</div>
	</div>
	<!-- /Page Sidebar Header -->
	<!-- Sidebar Menu -->
	<?php
	$this->load->view( 'common/sidebar' );
	?>
	<!-- /Sidebar Menu -->
</div>
<!-- /Page Sidebar -->
<!-- Page Content -->
<div class="page-content">
<!-- Page Breadcrumb -->
<?php
$this->load->view( 'common/bread' );
?>
<!-- /Page Breadcrumb -->
<!-- Page Header -->
<div class="page-header position-relative">
	<div class="header-title">
		<h1>
			附件管理
		</h1>
	</div>
	<!--Header Buttons-->
	<div class="header-buttons">
		<a class="sidebar-toggler" href="#">
			<i class="fa fa-arrows-h"></i>
		</a>
		<a class="refresh" id="refresh-toggler" href="">
			<i class="glyphicon glyphicon-refresh"></i>
		</a>
		<a class="fullscreen" id="fullscreen-toggler" href="#">
			<i class="glyphicon glyphicon-fullscreen"></i>
		</a>
	</div>
	<!--Header Buttons End-->
</div>
<!-- /Page Header -->
<!-- Page Body -->
<div class="page-body">

<div class="widget">
	<div class="widget-header bg-blue">
        <i class="widget-icon fa fa-folder-open"></i>
        <span class="widget-caption">/upfiles</span>
        <div class="widget-buttons">
        	<button id="tree-selectItem" class="btn btn-info">全选文件</button>
            <a href="#" data-toggle="maximize">
                <i class="fa fa-expand"></i>
            </a>
            <a href="#" data-toggle="collapse">
                <i class="fa fa-minus"></i>
            </a>
            <a href="#" data-toggle="dispose">
                <i class="fa fa-times"></i>
            </a>
        </div>
    </div>
	<div class="widget-body">
		<div id="MyTree" class="tree tree-plus-minus tree-unselectable">
            <div class="tree-folder" style="display: none;">
                <div class="tree-folder-header">
                    <i class="fa fa-folder"></i>
                    <div class="tree-folder-name"></div>
                </div>
                <div class="tree-folder-content">
                </div>
                <div class="tree-loader" style="display: none;"></div>
            </div>
            <div class="tree-item" style="display: none;">
                <i class="tree-dot"></i>
                <div class="tree-item-name"></div>
            </div>
        </div>
	</div>
	<div class="widget-footer">
		
	</div>
</div>
</div>
<!-- /Page Body -->
</div>
<!-- /Page Content -->
</div>
<!-- /Page Container -->
<!-- Main Container -->

</div>

<?php $this->load->view( 'common/footer' ); ?>

<script>
 $('#MyTree').tree({
    dataSource: new DataSourceTree({ url: '<?=site_url('upfile/get_tree/0');?>' }),
    multiSelect: false,
    loadingHTML: '<div class="tree-loading"><i class="icon-refresh icon-spin blue"></i></div>',
    'open-icon': 'icon-minus',
    'close-icon': 'icon-plus',
    'selectable': true,
    'selected-icon': 'icon-ok',
    'unselected-icon': 'icon-remove'
});

$('#MyTree').on('selected.fu.tree', function (event, data) {
  // do something with data: { selected: [array], target: [object] }
  console.log( data.name );
})
</script>
</body>
<!--  /Body -->
</html>
